package com.fjxd.feign.fallback;

import com.fjxd.feign.clients.PlaneTicketClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;

/**
 * @author csw
 */
@Slf4j
public class PlaneTicketClientFallbackFactory implements FallbackFactory<PlaneTicketClient> {
    @Override
    public PlaneTicketClient create(Throwable cause) {
        return null;
    }
//    @Override
//    public PlaneTicketClient create(Throwable cause) {
//        return new PlaneTicketClient() {
//            @Override
//            public PlaneTicket getTicketId(Integer id) {
//                log.error("机票查询故障",cause);
//                return new PlaneTicket();
//            }
//
//            @Override
//            public void ticketDeduct(Integer ticketId, Integer ticketType, Integer ticketCount) {
//                log.error("机票库存扣减异常",cause);
//            }
//
//            @Override
//            public void goBack(Integer aircraftTicketId, Integer ticketCount) {
//                log.error("机票库存回增异常",cause);
//            }
//        };
//    }
}
